package org.berlin.octane2m.kernel;

import org.berlin.octane2m.kernel.types.BootImage;

public class Table {

    /* Define stack sizes for the kernel tasks included in the system image. */
    public static final int NO_STACK    = 0;
    public static final int SMALL_STACK = 128 * 2;
    public static final int IDL_S       = SMALL_STACK;   /* 3 intr, 3 temps, 4 db for Intel */
    public static final int HRD_S       = NO_STACK;      /* dummy task, uses kernel stack */
    public static final int TSK_S       = SMALL_STACK;   /* system and clock task */
    
    /**
     * The system image table lists all programs that are part of the boot image. 
     * The order of the entries here MUST agree with the order of the programs
     * in the boot image and all kernel tasks must come first.
     * Each entry provides the process number, flags, quantum size (qs), scheduling
     * queue, allowed traps, ipc mask, and a name for the process table. The 
     * initial program counter and stack size is also provided for kernel tasks.
     */
    private BootImage image [];
            
    public Table() {
        super();
        loadBootImage();
    }
    
    protected void loadBootImage() {
        /*
         * PUBLIC struct boot_image image[] = {        
         *    // process nr,   pc, flags, qs,  queue, stack, traps, ipcto, call,  names //
         *    { IDLE,  idle_task, IDL_F,  8, IDLE_Q, IDL_S,     0,     0,     0, "IDLE"  },
         *    { CLOCK,clock_task, TSK_F, 64, TASK_Q, TSK_S, TSK_T,     0,     0, "CLOCK" },
         *    { SYSTEM, sys_task, TSK_F, 64, TASK_Q, TSK_S, TSK_T,     0,     0, "SYSTEM"},
         *    { HARDWARE,      0, TSK_F, 64, TASK_Q, HRD_S,     0,     0,     0, "KERNEL"},
         *    { PM_PROC_NR,    0, SRV_F, 32,      3, 0,     SRV_T, SRV_M,  PM_C, "pm"    },
         *    { FS_PROC_NR,    0, SRV_F, 32,      4, 0,     SRV_T, SRV_M,  FS_C, "fs"    },
         *    { RS_PROC_NR,    0, SRV_F,  4,      3, 0,     SRV_T, SYS_M,  RS_C, "rs"    },
         *    { TTY_PROC_NR,   0, SRV_F,  4,      1, 0,     SRV_T, SYS_M, DRV_C, "tty"   },
         *    { MEM_PROC_NR,   0, SRV_F,  4,      2, 0,     SRV_T, DRV_M, MEM_C, "memory"},
         *    { LOG_PROC_NR,   0, SRV_F,  4,      2, 0,     SRV_T, SYS_M, DRV_C, "log"   },
         *    { DRVR_PROC_NR,  0, SRV_F,  4,      2, 0,     SRV_T, SYS_M, DRV_C, "driver"},
         *    { INIT_PROC_NR,  0, USR_F,  8, USER_Q, 0,     USR_T, USR_M,     0, "init"  },
         *   };
         */
        
        // process nr,   pc, flags, qs,  queue, stack, traps, ipcto, call,  names //
        //final BootImage bi1 = new BootImage( IDLE,  idle_task, IDL_F,  8, IDLE_Q, IDL_S,     0,     0,     0, "IDLE"   );
        
    } //  End of the method //    
    
} // End of the class //
